package com.petter.lock.juc.semaphore;

import java.util.concurrent.Semaphore;

/**
 * @author : GD
 * @date :2021/12/20 : 22:55
 */
public class Semaphore10For1Thread {

    public static void main(String[] args) throws InterruptedException {
        Semaphore semaphore = new Semaphore(10);
        for (int i = 0; i < 11; i++) {
            semaphore.acquire();
            System.out.println("get semaphore :" + i);
        }
    }
}
